<%@page import="com.wed.db.assignment"%>
<%@page import="com.wed.db.ConnectDB"%>

<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
<link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/dataTables.colReorder.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/dataTables.colVis.css">

<style type="text/css" class="init">
</style>
<script type="text/javascript" language="javascript"
	src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script type="text/javascript" language="javascript"
	src="${pageContext.request.contextPath}/js/jquery.dataTables.js"></script>
<script type="text/javascript" language="javascript"
	src="${pageContext.request.contextPath}/js/dataTables.colReorder.js"></script>
<script type="text/javascript" language="javascript"
	src="${pageContext.request.contextPath}/js/dataTables.colVis.js"></script>


<script type="text/javascript" language="javascript" class="init">


$(document).ready(function() {
    var table = $('#example').DataTable( {
        dom: 'RC<"clear">lfrtip',
        columnDefs: [
            { visible: false, targets: 1 }
        ]
	} );
} );
$(document).ready(function() {
    var table = $('#example1').DataTable( {
        dom: 'RC<"clear">lfrtip',
        columnDefs: [
            { visible: false, targets: 1 }
        ]
	} );
} );
</script>
</head>

<body>
<%String gv= request.getParameter("username"); %>
<%String CreateAssignment = "CreateAssignment.jsp?username="+gv;%>
     <%String trangchugv = "TrangChuGV.jsp?username="+gv;%>
<%String CmapLecture = "CmapLecture.jsp?username="+gv;%>

    <%ArrayList<assignment> lst = new ConnectDB().getAssLec(gv);%>
      <%ArrayList<assignment> lt = new ConnectDB().getAssLecDaLam(gv);%>
<div id="main"><!-- Main starts here -->
<div id="header"><!-- Header starts here -->
	<img src="images/spkt.png" alt="" />
</div><!-- Header ends here -->
<div id="navigation">
<ul>
	<li><a href="#" title=""><font color="black" size="1">Xin Chào</font></a></li>
	<li><a href="#" title=""><%=gv%></a></li>
</ul>
</div>
<div id="contentHolder"><!-- Content Holder starts here -->
<div id="content"><!-- Content starts here -->
<div id="back">


<div class="clear"></div>

<div id="leftpart">
	<div class="container">
    <h1>Menu</h1>
    <ul>
    	<li><a href="<%=CreateAssignment %>">Tạo Bài Tập</a></li>
        <li><a href="<%=CmapLecture %>">Xem Bài Tập</a></li>
         <li><a href="#"></a></li>
        <li><a href="#"></a></li>
        <li><a href="#"></a></li>
        <li><a href="#"></a></li>
        <li><a href="#"></a></li>
    </ul>
    <div class="button"><input type="button" onclick="location.href='DangNhap.jsp'" value="Thoat" class="learnmore" /></div>
    </div>
</div>

<div id="middlepart">

	<h1>assignment chưa vẽ</h1>
	<table id="example1" class="display" cellspacing="0" width="100%">

				<thead>
					<tr background="#800517">

						<td width="20%" height="26" bgcolor="#CC6600">AssignmentID</td>
						<td width="30%" bgcolor="#CC6600">Assignment Name</td>
						<td width="20%" bgcolor="#CC6600">Decript</td>
						<td width="20%" bgcolor="#CC6600">DateCreate</td>
							<td width="20%" bgcolor="#CC6600">Dealine</td>
								<td width="20%" bgcolor="#CC6600"></td>

					</tr>
				</thead>
				<tbody>
					<%
				 for(assignment cm :lst){
					 String cmap = "VeConceptGV.jsp?AssignmentId="+cm.getAssignmentId()+"&username="+gv;
				 
				%>
					<tr>
					<td><%=cm.getAssignmentId() %></td>

						<td><%=cm.getAssiName() %></td>
						
						<td><%=cm.getDescript() %></td>
						<td><%=cm.getDateCreate() %></td>
						<td><%=cm.getDeadLine() %></td>
						<td><a href="<%=cmap%>">Draw </a></td>
						

						

					</tr>
					<%} %>

				</tbody>
			</table>
			<h1>Assignment Đã Vẽ</h1>
			<table id="example" class="display" cellspacing="0" width="100%">

				<thead>
					<tr background="#800517">

							<td width="20%" height="26" bgcolor="#CC6600">AssignmentID</td>
						<td width="30%" bgcolor="#CC6600">Assignment Name</td>
						<td width="20%" bgcolor="#CC6600">Decript</td>
						<td width="20%" bgcolor="#CC6600">DateCreate</td>
							<td width="20%" bgcolor="#CC6600">Dealine</td>
								<td width="20%" bgcolor="#CC6600"></td>
								<td width="20%" bgcolor="#CC6600"></td>
								<td width="20%" bgcolor="#CC6600"></td>

					</tr>
				</thead>
				<tbody>
					<%
				 for(assignment cm :lt){
					 String detail = "DetailCmapGV.jsp?AssignmentID="+cm.getAssignmentId();
					 String give = "GiaoBaiTap.jsp?AssignmentID="+cm.getAssignmentId()+"&username="+gv;
					 String btDaGiao = "BaiTapDaGiao.jsp?assignmentid="+cm.getAssignmentId()+"&username="+gv;
				%>
					<tr>
					<td><%=cm.getAssignmentId() %></td>

						<td><%=cm.getAssiName() %></td>
						
						<td><%=cm.getDescript() %></td>
						<td><%=cm.getDateCreate() %></td>
						<td><%=cm.getDeadLine() %></td>
						<td><a href="<%=give%>">Giao Bài Tập </a></td>
						<td><a href="<%=detail%>">Detail </a></td>
						<td><a href="<%=btDaGiao%>">DS Đã Giao </a></td>
						

						

					</tr>
					<%} %>

				</tbody>
			</table>
</div>



<div class="clear"></div>
<!--<div class="bottomImg"><img src="images/bottomBg.png" alt="" /></div>-->
</div>
</div><!-- Content ends here -->
</div><!-- Content Holder ends here -->
<div class="bottomImg"><img src="images/02.png" alt="" /></div>



<div id="footer"><!-- Footer starts here -->
<div lang="copy">Nhóm 5 Lớp 11110CLC</div>
<div class="design"><a href="#">Designed by Ngân-Trường-Hùng</a></div>
<div class="clear"></div>
</div><!-- Footer ends here -->
</div><!-- Main ends here -->
</body>
</html>
